<?php

require_once './include/common.inc.php';

$sql = "SELECT `id`, `name` FROM `pro_category` ORDER BY `orders` ASC, `id` DESC";
$query = $db->query($sql);
while($rs = $db->fetch_array($query)) {
	if($rs["name"]!="")
    	$p_category_ary[] = $rs;
}

$sql = "SELECT `id`, `name` FROM `pro_type` ORDER BY `orders` ASC, `id` DESC";
$query = $db->query($sql);
while($rs = $db->fetch_array($query)) {
	if($rs["name"]!="")
    	$p_type_ary[] = $rs;
}

$sql = "SELECT `id`, `pic`, `subject` FROM `med_promotion` WHERE `publish` = 1 AND `pic` != '' ORDER BY `id` DESC";
$query = $db->query($sql);
while($rs = $db->fetch_array($query)) {
    $special_product_ary[] = $rs;
    if (file_exists('pictures/promotion/' . $rs['pic'])) {
        $pic = "<img src='pictures/promotion/" . $rs['pic'] . "' width='156' height='96' border='0'><br><a href='current_specials.php?id=" . $rs['id'] . "'>" . $rs['subject'] . "</a>";
    }
    $special_product_out .= "<td valign=\"top\">" . $pic . "</td><td>&nbsp;</td>";
}

?>